package cn.laixueit;

import cn.laixueit.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
//        FileSystemXmlApplicationContext context =
//                new FileSystemXmlApplicationContext
//                        ("C:\\Users\\dx\\Desktop\\spring.xml");
//        UserService userService = (UserService) context.getBean("userService");
//        UserService userService = context.getBean("service", UserService.class);
//        userService.show();

//        Date date = context.getBean("date", Date.class);
//        System.out.println(date);

        UserService userService1 = context.getBean("userService", UserService.class);
//        UserService userService2 = context.getBean("userService", UserService.class);
//        UserService userService3 = context.getBean("userService", UserService.class);
        userService1.show();
//        System.out.println(userService1 == userService2);

    }
}
